package com.breakfast.fun.data.entity.user.invite;

import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;

import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by Administrator on 2016/8/24.
 */
public class Invite {

    /**
     * version : 1.0
     * success : true
     * msg :
     * data : [{},{"phone":"18359928890","nickname":"183****8890","photo":"http://static.52letsgo.cn","status":2,"statusName":"推荐成功","hurried":0}]
     */

    private String version;
    private boolean success;
    private String msg;
    private List<InviteData> data;

    public static Invite objectFromData(String str) {

        return new Gson().fromJson(str, Invite.class);
    }

    public static List<Invite> arrayInviteFromData(String str) {

        Type listType = new TypeToken<ArrayList<Invite>>() {
        }.getType();

        return new Gson().fromJson(str, listType);
    }

    public String getVersion() {
        return version;
    }

    public void setVersion(String version) {
        this.version = version;
    }

    public boolean isSuccess() {
        return success;
    }

    public void setSuccess(boolean success) {
        this.success = success;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public List<InviteData> getData() {
        return data;
    }

    public void setData(List<InviteData> data) {
        this.data = data;
    }

}
